/*
 * @Author: i@douxuefeng.cn
 * @Date: 2022-06-01 09:51:22
 * @LastEditTime: 2022-08-31 13:28:38
 * @LastEditors: i@douxuefeng.cn
 * @Description:
 * @FilePath: /go-utils/wechat/pay/pay.go
 */
package pay

type Pay interface {
	PrepayOrder(OrderRequest)
	QueryOrderByTransactionId(string)
	QueryOrderByOutTradeNo(string)
}

type OrderRequest struct {
	Description string  `json:"description"`
	OutTradeNo  string  `json:"out_trade_no"`
	Attach      string  `json:"attach"`
	Amount      float64 `json:"amount"` //单位元
	Openid      string  `json:"openid"`
	SubOpenid   string  `json:"sub_openid"` //子商户openid
	ClientIp    string  `json:"client_ip"`
	H5Info      string  `json:"h5_info"` // iOS, Android, Wap H5支付
}

type RefundRequest struct {
	SubMchid      string  `json:"sub_mchid"`
	TransactionId string  `json:"transaction_id"` //outradeno 填一个就可以
	OutTradeNo    string  `json:"out_trade_no"`
	OutRefundNo   string  `json:"out_refund_no"`
	Reason        string  `json:"reason"`
	NotifyUrl     string  `json:"notify_url"`
	Amount        float64 `json:"amount"`
}
